package lab01;

import java.util.Scanner;

public class Test12 {
    public static void main(String[] args) {
        Scanner  sc=new Scanner(System.in);
        System.out.println("请输入一个数： ");
        int num =sc.nextInt();

        while(num>=1 && num<=9999) {

            int ones = num % 10;
            int tens = num / 10 % 10;
            int hundreds = num / 10 / 10 % 10;
            int thousands = num / 10 / 10 / 10 % 10;

            if (thousands == 0) {
                System.out.println("这是一个三位数！");
            }
            if (thousands == 0 && hundreds == 0) {
                System.out.println("这是一个两位数！");
            }
            if (thousands == 0 && hundreds == 0 && tens == 0) {
                System.out.println("这是一个一位数！");
            }


            if (ones == thousands && tens == hundreds) {
                System.out.println(num+"是一个回文！");
            }
            break;
        }
    }
}
